package com.web.kdl.util;

import java.security.SecureRandom;

/**
 * @Author： shulibin
 * @Date： 2025/7/23 17:19
 * @Describe：
 */
public class PasswordGenerator {

    private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    private static final int PASSWORD_LENGTH = 10; // 可以根据需要调整密码长度

    public static String generatePassword() {
        SecureRandom random = new SecureRandom();
        StringBuilder passwordBuilder = new StringBuilder();
        for (int i = 0; i < PASSWORD_LENGTH; i++) {
            int index = random.nextInt(CHARACTERS.length());
            passwordBuilder.append(CHARACTERS.charAt(index));
        }
        return passwordBuilder.toString();
    }

}